﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace K9Nano.IM.Models
{
    public class ChatRoom: BasePoco
    {
        [Required]
        public Guid CustomerId { get; set; }

        [Display(Name = "名称")]
        [Required(AllowEmptyStrings = false)]
        [StringLength(200, ErrorMessage = "{0}stringmax{1}")]
        public string Name { get; set; }

        [Required]
        public Guid AppId { get; set; }

        public virtual User Customer { get; set; }

        public virtual List<ChatRoomMember> Members { get; set; }
    }

    public class ChatRoomMember : BasePoco
    {
        [Display(Name = "群聊")]
        [Required]
        public Guid RoomId { get; set; }

        [Display(Name = "群聊")]
        public virtual ChatRoom Room { get; set; }

        [Display(Name = "成员")]
        [Required]
        public Guid MemberId { get; set; }

        [Display(Name = "成员")]
        public virtual User Member { get; set; }
    }
}